﻿using Albatross.WPF.Common.ViewModels;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Albatross.SharePoint.Explorer.ViewModels {
	public class ContentTypeViewModel : ClientObjectViewModel{
		public ContentTypeViewModel(ClientContext context, string name, ContentType ct) : base(context, name, ct) { }

		public ContentType ContentType { get { return (ContentType)ClientObject; } }

		public override string GetTreeItemTitle() {
			if (Name == string.Empty) {
				return ContentType.Name;
			} else {
				return Name;
			}
		}

		public override string GetContentTitle() {
			return ContentType.Name;
		}
	}
}
